﻿using Super_Management_Mayhem.Content.Spritesheet;
using Transformable_Engine_v2.Engine.GameObjects.Containers;
using Transformable_Engine_v2.Engine.GameObjects.Containers.Transformable_controls;
using Transformable_Engine_v2.Engine.Transformable_Math.Geometry;

namespace Super_Management_Mayhem.Screens.Menu.CreateAvatarName
{
    public class KeyboardBackground : Container
    {
         public KeyboardBackground(TE_Vector2 size)
         {
             AddChildren(new ImageContainer {
                                                PositionGridBound = new TE_Vector2(0, 0),
                                                Sprite = MenuSheet.GetSprite(MenuSheet.KeyboardOutline.TopLeftCorner),
                                                Origin = TE_Rectangle.Alignment.TopLeft
                                            });

             AddChildren(new ImageContainer {
                                                PositionGridBound = new TE_Vector2(size.X, 0),
                                                Sprite = MenuSheet.GetSprite(MenuSheet.KeyboardOutline.TopRightCorner),
                                                Origin = TE_Rectangle.Alignment.TopRight
                                            });
             AddChildren(new ImageContainer {
                                                PositionGridBound = new TE_Vector2(0, size.Y),
                                                Sprite = MenuSheet.GetSprite(MenuSheet.KeyboardOutline.BottomLeftCorner),
                                                Origin = TE_Rectangle.Alignment.BottomLeft
                                            });
             AddChildren(new ImageContainer {
                                                PositionGridBound = size,
                                                Sprite = MenuSheet.GetSprite(MenuSheet.KeyboardOutline.BottomRightCorner),
                                                Origin = TE_Rectangle.Alignment.BottomRight
                                            });

             AddChildren(new RepeatingImage {
                                                PositionGridBound = new TE_Vector2(1, 0),
                                                Sprite = MenuSheet.GetSprite(MenuSheet.KeyboardOutline.Top),
                                                Origin = TE_Rectangle.Alignment.TopLeft,
                                                Area = new TE_Vector2(size.X - 2, 1)
                                            });

             AddChildren(new RepeatingImage {
                                                PositionGridBound = new TE_Vector2(1, 1),
                                                Sprite = MenuSheet.GetSprite(MenuSheet.KeyboardOutline.Center),
                                                Origin = TE_Rectangle.Alignment.TopLeft,
                                                Area = new TE_Vector2(size.X - 2, size.Y - 2)
                                            });

             AddChildren(new RepeatingImage {
                                                PositionGridBound = new TE_Vector2(0, 1),
                                                Sprite = MenuSheet.GetSprite(MenuSheet.KeyboardOutline.Left),
                                                Origin = TE_Rectangle.Alignment.TopLeft,
                                                Area = new TE_Vector2(1, size.Y - 2)
                                            });

             AddChildren(new RepeatingImage {
                                                PositionGridBound = new TE_Vector2(size.X, 1),
                                                Sprite = MenuSheet.GetSprite(MenuSheet.KeyboardOutline.Right),
                                                Origin = TE_Rectangle.Alignment.TopRight,
                                                Area = new TE_Vector2(1, size.Y - 2)
                                            });

             AddChildren(new RepeatingImage {
                                                PositionGridBound = new TE_Vector2(1, size.Y),
                                                Sprite = MenuSheet.GetSprite(MenuSheet.KeyboardOutline.Bottom),
                                                Origin = TE_Rectangle.Alignment.BottomLeft,
                                                Area = new TE_Vector2(size.X - 2, 1)
                                            });
         }
    }
}